setfenv(1, require'winapi')
require'winapi.winuser'

ffi.cdef[[
HGDIOBJ  GetStockObject(int i);
]]

WHITE_BRUSH          = 0
LTGRAY_BRUSH         = 1
GRAY_BRUSH           = 2
DKGRAY_BRUSH         = 3
BLACK_BRUSH          = 4
NULL_BRUSH           = 5
HOLLOW_BRUSH         = NULL_BRUSH
WHITE_PEN            = 6
BLACK_PEN            = 7
NULL_PEN             = 8
OEM_FIXED_FONT       = 10
ANSI_FIXED_FONT      = 11
ANSI_VAR_FONT        = 12
SYSTEM_FONT          = 13
DEVICE_DEFAULT_FONT  = 14
DEFAULT_PALETTE      = 15
SYSTEM_FIXED_FONT    = 16
DEFAULT_GUI_FONT     = 17

function GetStockObject(i)
	return checkh(ffi.C.GetStockObject(i))
end

--showcase
if not ... then
print(GetStockObject(WHITE_BRUSH))
print(GetStockObject(DEFAULT_GUI_FONT))
end
